
class Student:
    def __init__(self, id, name):
        self.id = id
        self.name = name
        self.km = {'语文': 0, '数学': 0, '英语': 0}
    def set_km(self, km, n):
        self.km[km] = n
    def p(self):
        for c in self.km:
            print(c, self.km[c])

xm = Student(11, '小美')
xm.set_km('语文', 90)
xm.set_km('数学', 80)
xm.set_km('英语', 70)
xm.p()





